package com.shhm.business.service.impl.business;

import com.shhm.business.mapper.ProductMapper;
import com.shhm.business.mapper.ProductTypeMapper;
import com.shhm.business.service.business.BusinessSearchService;
import com.shhm.common.dto.response.AjaxResultPlus;
import com.shhm.common.entity.common.ProductTypeEntity;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/11 下午3:41
 */
@Service
public class
BusinessSearchServiceImpl implements BusinessSearchService {
    @Resource
    private ProductMapper productMapper;
    @Resource
    private ProductTypeMapper productTypeMapper;

    @Override
    public AjaxResultPlus getHomeOverview() {
        Map<String, Object> resMap = new HashMap<>();
        AjaxResultPlus res = AjaxResultPlus.custom(200, false);
        List<ProductTypeEntity> prodTypeList = productTypeMapper.selectList(null);
        resMap.put("AllCategories", prodTypeList);
        return res.put("data", resMap);
    }
}
